﻿using GestionSaludOcupacional.Repository.Interfaces;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Linq;

namespace GestionSaludOcupacional.Portal.Tests
{
    
    
    /// <summary>
    ///This is a test class for IRepositoryTest and is intended
    ///to contain all IRepositoryTest Unit Tests
    ///</summary>
    [TestClass()]
    public class IRepositoryTest
    {


        private TestContext testContextInstance;

        /// <summary>
        ///Gets or sets the test context which provides
        ///information about and functionality for the current test run.
        ///</summary>
        public TestContext TestContext
        {
            get
            {
                return testContextInstance;
            }
            set
            {
                testContextInstance = value;
            }
        }

        #region Additional test attributes
        // 
        //You can use the following additional attributes as you write your tests:
        //
        //Use ClassInitialize to run code before running the first test in the class
        //[ClassInitialize()]
        //public static void MyClassInitialize(TestContext testContext)
        //{
        //}
        //
        //Use ClassCleanup to run code after all tests in a class have run
        //[ClassCleanup()]
        //public static void MyClassCleanup()
        //{
        //}
        //
        //Use TestInitialize to run code before running each test
        //[TestInitialize()]
        //public void MyTestInitialize()
        //{
        //}
        //
        //Use TestCleanup to run code after each test has run
        //[TestCleanup()]
        //public void MyTestCleanup()
        //{
        //}
        //
        #endregion


        /// <summary>
        ///A test for Add
        ///</summary>
        public void AddTestHelper<E>()
        {
            IRepository<E> target = CreateIRepository<E>(); // TODO: Initialize to an appropriate value
            E entity = default(E); // TODO: Initialize to an appropriate value
            target.Add(entity);
            Assert.Inconclusive("A method that does not return a value cannot be verified.");
        }

        internal virtual IRepository<E> CreateIRepository<E>()
        {
            // TODO: Instantiate an appropriate concrete class.
            IRepository<E> target = null;
            return target;
        }

        [TestMethod()]
        public void AddTest()
        {
            AddTestHelper<GenericParameterHelper>();
        }

        /// <summary>
        ///A test for All
        ///</summary>
        public void AllTestHelper<E>()
        {
            IRepository<E> target = CreateIRepository<E>(); // TODO: Initialize to an appropriate value
            IQueryable<E> expected = null; // TODO: Initialize to an appropriate value
            IQueryable<E> actual;
            actual = target.All();
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("Verify the correctness of this test method.");
        }

        [TestMethod()]
        public void AllTest()
        {
            AllTestHelper<GenericParameterHelper>();
        }

        /// <summary>
        ///A test for All
        ///</summary>
        public void AllTest1Helper<E>()
        {
            IRepository<E> target = CreateIRepository<E>(); // TODO: Initialize to an appropriate value
            string includes = string.Empty; // TODO: Initialize to an appropriate value
            IQueryable<E> expected = null; // TODO: Initialize to an appropriate value
            IQueryable<E> actual;
            actual = target.All(includes);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("Verify the correctness of this test method.");
        }

        [TestMethod()]
        public void AllTest1()
        {
            AllTest1Helper<GenericParameterHelper>();
        }

        /// <summary>
        ///A test for Remove
        ///</summary>
        public void RemoveTestHelper<E>()
        {
            IRepository<E> target = CreateIRepository<E>(); // TODO: Initialize to an appropriate value
            E entity = default(E); // TODO: Initialize to an appropriate value
            target.Remove(entity);
            Assert.Inconclusive("A method that does not return a value cannot be verified.");
        }

        [TestMethod()]
        public void RemoveTest()
        {
            RemoveTestHelper<GenericParameterHelper>();
        }

        /// <summary>
        ///A test for Save
        ///</summary>
        public void SaveTestHelper<E>()
        {
            IRepository<E> target = CreateIRepository<E>(); // TODO: Initialize to an appropriate value
            target.Save();
            Assert.Inconclusive("A method that does not return a value cannot be verified.");
        }

        [TestMethod()]
        public void SaveTest()
        {
            SaveTestHelper<GenericParameterHelper>();
        }
    }
}
